package com.pan.script;

import com.pan.exe.Executive;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;

public interface ScriptTranslators {

    public Executive to(String[] lines);

    public default Executive to(InputStream inputStream){
        BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
        String[] lines = reader.lines().toArray(String[]::new);
        return to(lines);
    }

    public default Executive to(String text){
        String[] lines = text.split("\n");
        return  to(lines);
    }
}
